/**
 * Created by Delicate on 2018/1/3.
 */
import React from 'react';
import {
    View,
} from 'react-native';

import NavBar from '../../components/NavBarView'
import ServerWeb from '../../components/ServerWebView'

class Views extends React.Component {

    constructor(prop) {
        super(prop);
        this.state = {
            id: '',
            title: ''
        }
        this.state.id = this.props.navigation.state.params.id;
        this.state.title = this.props.navigation.state.params.title;
    }

    render() {
        return (
            <View style={base.baseOuter}>
                <NavBar host={this} title={this.state.title || '平台协议'}/>
                <ServerWeb url={`/web/agreement?id=${this.state.id}`}/>
            </View>
        )
    }
}

//路由
const Agreement = {
    screen: Views,
    navigationOptions: {
        header: null,
    },
    name: 'Agreement',
    sign: false
};

export default Agreement;